//
//  moreViewController.m
//  movie
//
//  Created by 李丹阳 on 15/7/17.
//  Copyright (c) 2015年 李丹阳. All rights reserved.
//

#import "moreViewController.h"
#import "moreModal.h"
#import "moreTableViewCell.h"

@interface moreViewController ()

@end

@implementation moreViewController

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title = @"更多";
    }
    return self;
}

- (void)_createTableView{
    _moreTableView = [[UITableView alloc]initWithFrame:self.view.bounds];
    _moreTableView.delegate = self;
    _moreTableView.dataSource = self;
    _moreTableView.backgroundColor = [UIColor blackColor];
    
    [self.view addSubview:_moreTableView];
    
    UINib* nib = [UINib nibWithNibName:@"moreTableViewCell" bundle:nil];
    [_moreTableView registerNib:nib forCellReuseIdentifier:@"cell"];
    
}

- (void)loadData{

    _titleNameArray = [[NSMutableArray alloc]initWithObjects:@"清理缓存",@"给个评价",@"检查新版本",@"商务合作",@"欢迎页",@"关于" ,nil];
    
    _iconImageArray = [[NSMutableArray alloc]initWithObjects:@"102D6885-C096-4795-8C55-35B7E6B1128C",@"496BCED7-6483-44ED-9860-BA221F69B395",@"DD9541C1-E7B0-41FC-B153-01B4AC415FDB",@"98C56F36-BD16-41A8-956E-76AA0781AB21",@"007954BC-00D3-4178-8D69-79E90DEAA3EE",@"1074ADE1-4737-47FD-A348-E829A64EAD62", nil];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 6;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    moreTableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    cell.titleName = _titleNameArray[indexPath.row];
    cell.imageName = _iconImageArray[indexPath.row];

    return cell;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor blackColor];
    [self _createTableView];
    [self loadData];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
